/*
/!*
// invoked in master
import {think} from "thinkjs";
const Sequelize = require('sequelize');
const {STRING, INTEGER, DATE} = Sequelize;
const {model} = require('../config/adapter');
const schemas = require('../schema/index');
const sequelize = new Sequelize(model.mysql.database, model.mysql.user, model.mysql.password, {
    host: model.mysql.host,
    dialect: 'mysql',
    operatorsAliases: false,
    freezeTableName: true,
    logging: think.logger.debug,
    define: {
        timestamps: true,
        freezeTableName: true,
    },
    timezone: '+08:00', // 东八时区
    pool: {
        max: 10,
        min: 0,
        acquire: 30000,
    }
});

sequelize.authenticate().then(
    () => {
        schemas.forEach((schema: any) => {
            sequelize.define(...schema);
        });
        sequelize.sync({force: false, alter: true}).then(async () => {
            console.info('===>> Tables data sync success');
        });
    }
).catch((err: any) => {
    process.on('exit', () => {
        console.error(`===>> Unable to connect to the database:${err.message}`);
    });
    process.exit(1);
});
*!/

idle: 10000*/
